package com.edu.neusoft.elec_shop.domain;

import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
public class ShoppingCart {
    @NotNull(message = "购物车编号不能为空")
    private Long cartId;

    @NotNull(message = "用户ID不能为空")
    private Long userId;

    @NotNull(message = "商品ID不能为空")
    private Long goodsId;

    @NotBlank(message = "商品名称不能为空")
    private String goodsName;

    @Min(value = 0, message = "购物车内商品数量不能为负数")
    @Max(value = 1000, message = "购物车内商品数量不能超出1000")
    private String quantity;

    @Min(value = 0, message = "购物车商品总价不能为负数")
    private String cartAmount;

}